Game xếp hình Tetris C#
- Constantes.cs
- project /
1 using System;
2 using System.Drawing;
3
4 namespace Tetris
5 {
6 /// <summary>
7 /// Descripción breve de Constantes.
8 /// </summary>
9 public class Constantes
10 {
11 public const int FILAS_PIEZAS = 4;
12 public const int COLUMNAS_PIEZAS = 4;
13 public const int NUM_PIEZAS = 7;
14 public const int NUM_ROTACIONES = 4;
15 public const int FILAS_PANTALLA = 21;
16 public const int COLUMNAS_PANTALLA = 13;
17 public const int ANCHO_CELDA = 20;
18 public const int ALTO_CELDA = 20;
19 public const int NUM_LINEAS_POR_NIVEL = 20;
20
21 private static Color [] m_COLORES = new Color[7]{Color.Red, Color.Blue, Color.DarkOrange, Color.DeepPink, Color.Violet, Color.Beige, Color.DarkMagenta};
22
23 private static int [] m_NIVELES = new int[10]{1000, 800, 640, 512, 410, 328, 262, 210, 168, 134};
24
25
26 public static Color COLORES(int color)
27 {
28 return m_COLORES[color];
29 }
30
31 public static int NIVELES(int nivel)
32 {
33 return m_NIVELES[nivel];
34 }
35 }
36 }
2 using System.Drawing;
3
4 namespace Tetris
5 {
6 /// <summary>
7 /// Descripción breve de Constantes.
8 /// </summary>
9 public class Constantes
10 {
11 public const int FILAS_PIEZAS = 4;
12 public const int COLUMNAS_PIEZAS = 4;
13 public const int NUM_PIEZAS = 7;
14 public const int NUM_ROTACIONES = 4;
15 public const int FILAS_PANTALLA = 21;
16 public const int COLUMNAS_PANTALLA = 13;
17 public const int ANCHO_CELDA = 20;
18 public const int ALTO_CELDA = 20;
19 public const int NUM_LINEAS_POR_NIVEL = 20;
20
21 private static Color [] m_COLORES = new Color[7]{Color.Red, Color.Blue, Color.DarkOrange, Color.DeepPink, Color.Violet, Color.Beige, Color.DarkMagenta};
22
23 private static int [] m_NIVELES = new int[10]{1000, 800, 640, 512, 410, 328, 262, 210, 168, 134};
24
25
26 public static Color COLORES(int color)
27 {
28 return m_COLORES[color];
29 }
30
31 public static int NIVELES(int nivel)
32 {
33 return m_NIVELES[nivel];
34 }
35 }
36 }